import { defineStore } from 'pinia'
import {reqShopCartListData} from '../api/shopCart'


export const useShopStore = defineStore('shop', {
  state: () => {
    return { 
      cartInfoList:[]
    }
  },
  actions: {
    async getShopCartListData(){
    // window.localStorage.setItem('userTempId','e3c6a129-19b1-4478-b3ad-c84d7c141c0c')
    // window.localStorage.setItem('token','1e362841d08048a4b7907b973aa50ff4')
      const res:any = await reqShopCartListData()
      this.cartInfoList = (res[0]||{}).cartInfoList||[] 
    },
  },
})